<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    {if request()->get('parent_id')}
    <div class="form-group">
        <label for="c-parent_id" class="control-label col-xs-12 col-sm-2">{:__('Parent_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-parent_id" data-rule="required" data-source="parent/index" class="form-control selectpage" name="row[parent_id]" type="text" value="{$row.parent_id}">
        </div>
    </div>
    {/if}
    <div class="form-group">
        <label for="c-code" class="control-label col-xs-12 col-sm-2">{:__('Code')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-code" data-rule="required" class="form-control" name="row[code]" type="text" value="{$row.code}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-address" class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address" class="form-control" name="row[address]" type="text" value="{$row.address}">
        </div>
    </div>
    <div class="form-group">
        <label for="companyid" class="control-label col-xs-12 col-sm-2">{:__('Company')}:</label>
        <div class="col-xs-12 col-sm-6">
            <select id="companyid" data-rule="required" class="form-control selectpicker show-tick" name="row[companyid]" data-live-search="true">
                <option value="0">无</option>
                {foreach name="company" item="vo"}
                <option value="{$vo.id}" {in name="vo.id" value="$row.companyid" }selected{/in}>{$vo.companyname}
                </option>
                {/foreach}
            </select>
        </div>
    </div>

    <div class="form-group">
        <label for="c-type" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[type]', ['0'=>__('RentNew'),'1'=>__('RentRenew'),'2'=>__('RentSublet')],$row['type'])}
        </div>
    </div>
    <div class="form-group">
        <label for="c-contract" class="control-label col-xs-12 col-sm-2">{:__('Contract')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-inline">
                <input id="c-contract" class="form-control" size="50" name="row[contract]" type="hidden" value="{$row.contract}">
                <span><button id="plupload-image" class="btn btn-danger plupload" data-input-id="c-contract"
                        data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-preview-id="p-contract"
                        data-multiple="true"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-multiple="true"
                        data-mimetype="image/*" data-input-id="c-contract"><i class="fa fa-list-ul"></i>
                        {:__('Choose')}</button></span>
                <ul class="row list-inline plupload-preview" id="p-contract"></ul>
            </div>
        </div>
    </div>


    <div class="form-group">
        <label for="c-start_time" class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-start_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[start_time]" type="text" value="{$row.start_time|datetime}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-end_time" class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-end_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[end_time] " type="text " value="{$row.end_time|datetime} ">
        </div>
    </div>
    <div class="form-group">
        <label for="c-leases " class="control-label col-xs-12 col-sm-2 ">{:__('Leases')}:</label>
        <div class="col-xs-12 col-sm-8 ">
            <input id="c-leases" class="form-control " name="row[leases] " type="text " value="{$row.leases} " data-rule="required;" placeholder="合同租期多少天 " onclick="autoMondiff(); ">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('FreeRent')}(天):</label>
        <div class="col-xs-12 col-sm-8">
            <input type="number" class="form-control" id="freeRent" name="row[freerent]" value="{$row.freerent}" data-rule="decimal" placeholder="赠送的天数" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Cycle')}(年):</label>
        <div class="col-xs-12 col-sm-8">
            <input type="number" class="form-control" id="cycle" name="row[cycle]" value="{$row.cycle}" data-rule="decimal" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Percentag')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="number" class="form-control" id="percentage" name="row[percentage]" value="{$row.percentage}" data-rule="decimal" placeholder="上浮比例" />
        </div>
    </div>
    <div class="form-group">
        <label for="c-remarks" class="control-label col-xs-12 col-sm-2 ">{:__('Remarks')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-remarks" class="form-control" name="row[remarks]" type="text">{$row.remarks}</textarea>

        </div>
    </div>
    <div class="form-group layer-footer ">
        <label class="control-label col-xs-12 col-sm-2 "></label>
        <div class="col-xs-12 col-sm-8 ">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="button" class="btn btn-default btn-embossed" onClick="closeLayerWin(this)">{:__('Close')}</button>

        </div>
    </div>
</form>